#ifndef __PACKAGE_H
#define __PACKAGE_H

#include <zip.h>
#include <judge_fs.h>
#include "linked_list.h"

struct testcase {
	const char *input_path;
	const char *output_path;
};

struct package {
	/* inherit */
	struct judge_fs fs;
	/* implementation */
	struct zip *zip;
	struct zip_file *config_file;
	char *temp_buffer;
	/* metadata */
	uint32_t time_limit;
	uint32_t memory_limit;
	uint32_t has_spj;
	uint32_t testcase_count;
	struct linked_list testcase_list;
	const char *spj_prefix;
	uint32_t spj_key_count;
	struct linked_list spj_key_list;
};

struct package *package_new();
void package_delete(struct package *);
jstatus_t package_assign(struct package *, const char *);

#endif